class Container {
  static of(v) {
    return new Container(v);
  }
  constructor(v) {
    this._v = v;
  }
  map(fn) {
    return Container.of(fn(this._v));
  }
}
class Maybe {
  static of(v) {
    return new Maybe(v);
  }
  constructor(v) {
    this._v = v;
  }
  map(fn) {
    return this.isNothing() ? Maybe.of(null) : Maybe.of(fn(this._v));
  }
  isNothing() {
    return this._v === null || this._v === undefined;
  }
}

module.exports = { Container, Maybe };
